Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@pnpm/logger
Advanced tools
@pnpm/logger is a logging utility designed for use with the pnpm package manager. It provides a structured way to log messages with different levels of severity and categories, making it easier to track and debug issues in pnpm-related projects.
Basic Logging
This feature allows you to log messages with different levels of severity such as info, warn, and error.
const logger = require('@pnpm/logger')('my-logger');
logger.info({ message: 'This is an info message' });
logger.warn({ message: 'This is a warning message' });
logger.error({ message: 'This is an error message' });
Custom Loggers
You can create custom loggers with specific namespaces to better organize your logging output.
const logger = require('@pnpm/logger');
const customLogger = logger('custom-namespace');
customLogger.info({ message: 'This is a custom info message' });
Structured Logging
This feature allows you to log structured data, making it easier to filter and analyze logs.
const logger = require('@pnpm/logger')('structured-logger');
logger.info({ event: 'user_signup', userId: 12345, message: 'User signed up successfully' });
Winston is a versatile logging library for Node.js that supports multiple transports (e.g., console, file, HTTP) and log levels. It offers more flexibility and customization options compared to @pnpm/logger.
Bunyan is a simple and fast JSON logging library for Node.js. It provides a structured logging format and includes features like log rotation and streaming. It is similar to @pnpm/logger in terms of structured logging but offers additional features like log rotation.
Pino is a low-overhead logging library for Node.js that focuses on performance. It provides fast and efficient logging with a simple API. Pino is more performance-oriented compared to @pnpm/logger.
Logger for pnpm
pnpm add @pnpm/logger
@pnpm/logger
is mostly just a wrapper over bole.
Logging is done the same way as in bole. To listed for logs, use streamParser
or create
a new parser with createStreamParser()
.
import logger, {streamParser} from '@pnpm/logger'
logger.debug({ foo: 'bar' })
streamParser.on('data', msg => {
// ...
})
MIT
FAQs
Logger for pnpm
The npm package @pnpm/logger receives a total of 629,502 weekly downloads. As such, @pnpm/logger popularity was classified as popular.
We found that @pnpm/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.